package org.jackysoft.service;

import java.util.Collection;

import org.apache.lucene.queryParser.ParseException;
import org.jackysoft.data.IDataProvider;
import org.jackysoft.entity.AcegiRole;
import org.jackysoft.entity.Department;
import org.jackysoft.entity.Role;
import org.jackysoft.entity.User;
import org.jackysoft.util.Page;
import org.springframework.dao.DataAccessException;

public interface UserService extends IDataProvider<String,User> {
	
	User getByLogin(java.io.Serializable id) throws DataAccessException;

    void marked4Remove(User owner) throws DataAccessException;

	Collection<User> gets(AcegiRole acegi) throws DataAccessException;

	Collection<User> getsBySameDepartment() throws DataAccessException;

	Collection<User> gets(Department dept) throws DataAccessException;

	Collection<User> gets(Collection<Department> depts)
			throws DataAccessException;

	Collection<User> gets(Role dept) throws DataAccessException;
	

	Collection<User> getsByRoles(Collection<Role> roles) throws DataAccessException;

	Page gets(Department dept, int start, int size) throws DataAccessException;
	
	Page gets(Role role, int start, int size) throws DataAccessException;


	void reset(Department dept) throws DataAccessException;


	void saveProfile(User user) throws DataAccessException;

	/**
	 * 返回jstree 的搜索路径
	 * 
	 * @throws ParseException
	 * */
	Collection<User> searchs(final String searchString)throws DataAccessException, ParseException;
	
	void pass(Collection<User> beans) throws DataAccessException;
    boolean exists(String username) throws DataAccessException;
}
